#include<reg52.h>
#include<stdio.h>
#include<string.h>
#include<intrins.h>

void send_msg(char * msg){
	while(*msg != '\0'){
		SBUF=*msg++;
		while(TI==0);
		TI=0;
	}
}
static char msg[16];
static int count=0;
void main(void){
	SCON=0x50;
	TMOD |= 0x20;
	TH1 = 221;
	TR1=1;
	ET0=1;
	EA=1;
	
	TMOD |= 0x1;  //T0=16bit counter
	TL0 =0;
	TH0= 0;
	TR0=1;
	
	while(1){
	}
}
void timer0_int() interrupt 1 using 1{
	sprintf(msg,"hello %d\n",count++);
	send_msg(msg);
}